Optimal. Leaf size=41 \[ -\frac {b \text {ArcTan}\left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^{3/2}}-\frac {\cot (x)}{a+b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 41, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3270, 396, 211}
\begin {gather*} -\frac {b \text {ArcTan}\left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^{3/2}}-\frac {\cot (x)}{a+b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 396
Rule 3270
Rubi steps
\begin {align*} \int \frac {\csc ^2(x)}{a+b \cos ^2(x)} \, dx &=-\text {Subst}\left (\int \frac {1+x^2}{a+(a+b) x^2} \, dx,x,\cot (x)\right )\\ &=-\frac {\cot (x)}{a+b}-\frac {b \text {Subst}\left (\int \frac {1}{a+(a+b) x^2} \, dx,x,\cot (x)\right )}{a+b}\\ &=-\frac {b \tan ^{-1}\left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^{3/2}}-\frac {\cot (x)}{a+b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.11, size = 40, normalized size = 0.98 \begin {gather*} \frac {b \text {ArcTan}\left (\frac {\sqrt {a} \tan (x)}{\sqrt {a+b}}\right )}{\sqrt {a} (a+b)^{3/2}}-\frac {\cot (x)}{a+b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.15, size = 39, normalized size = 0.95
method | result | size |
default | \(-\frac {1}{\left (a +b \right ) \tan \left (x \right )}+\frac {b \arctan \left (\frac {a \tan \left (x \right )}{\sqrt {\left (a +b \right ) a}}\right )}{\left (a +b \right ) \sqrt {\left (a +b \right ) a}}\) | \(39\) |
risch | \(-\frac {2 i}{\left ({\mathrm e}^{2 i x}-1\right ) \left (a +b \right )}+\frac {b \ln \left ({\mathrm e}^{2 i x}+\frac {-2 i a^{2}-2 i a b +2 a \sqrt {-a^{2}-a b}+b \sqrt {-a^{2}-a b}}{b \sqrt {-a^{2}-a b}}\right )}{2 \sqrt {-a^{2}-a b}\, \left (a +b \right )}-\frac {b \ln \left ({\mathrm e}^{2 i x}+\frac {2 i a^{2}+2 i a b +2 a \sqrt {-a^{2}-a b}+b \sqrt {-a^{2}-a b}}{b \sqrt {-a^{2}-a b}}\right )}{2 \sqrt {-a^{2}-a b}\, \left (a +b \right )}\) | \(187\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.48, size = 38, normalized size = 0.93 \begin {gather*} \frac {b \arctan \left (\frac {a \tan \left (x\right )}{\sqrt {{\left (a + b\right )} a}}\right )}{\sqrt {{\left (a + b\right )} a} {\left (a + b\right )}} - \frac {1}{{\left (a + b\right )} \tan \left (x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 82 vs.
\(2 (33) = 66\).
time = 0.45, size = 228, normalized size = 5.56 \begin {gather*} \left [-\frac {\sqrt {-a^{2} - a b} b \log \left (\frac {{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (x\right )^{4} - 2 \, {\left (4 \, a^{2} + 3 \, a b\right )} \cos \left (x\right )^{2} + 4 \, {\left ({\left (2 \, a + b\right )} \cos \left (x\right )^{3} - a \cos \left (x\right )\right )} \sqrt {-a^{2} - a b} \sin \left (x\right ) + a^{2}}{b^{2} \cos \left (x\right )^{4} + 2 \, a b \cos \left (x\right )^{2} + a^{2}}\right ) \sin \left (x\right ) + 4 \, {\left (a^{2} + a b\right )} \cos \left (x\right )}{4 \, {\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} \sin \left (x\right )}, -\frac {\sqrt {a^{2} + a b} b \arctan \left (\frac {{\left (2 \, a + b\right )} \cos \left (x\right )^{2} - a}{2 \, \sqrt {a^{2} + a b} \cos \left (x\right ) \sin \left (x\right )}\right ) \sin \left (x\right ) + 2 \, {\left (a^{2} + a b\right )} \cos \left (x\right )}{2 \, {\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} \sin \left (x\right )}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\csc ^{2}{\left (x \right )}}{a + b \cos ^{2}{\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.44, size = 55, normalized size = 1.34 \begin {gather*} \frac {{\left (\pi \left \lfloor \frac {x}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (x\right )}{\sqrt {a^{2} + a b}}\right )\right )} b}{\sqrt {a^{2} + a b} {\left (a + b\right )}} - \frac {1}{{\left (a + b\right )} \tan \left (x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.30, size = 34, normalized size = 0.83 \begin {gather*} \frac {b\,\mathrm {atan}\left (\frac {\sqrt {a}\,\mathrm {tan}\left (x\right )}{\sqrt {a+b}}\right )}{\sqrt {a}\,{\left (a+b\right )}^{3/2}}-\frac {1}{\mathrm {tan}\left (x\right )\,\left (a+b\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________